"use client";

import { notification } from 'antd';
import { createContext, useContext } from 'react';

const NotificationContext = createContext<typeof notification | null>(null);

export function NotificationProvider({ children }: { children: React.ReactNode }) {
  return (
    <NotificationContext.Provider value={notification}>
      {children}
    </NotificationContext.Provider>
  );
}

export const useNotification = () => {
  const notification = useContext(NotificationContext);
  if (!notification) {
    throw new Error('useNotification must be used within NotificationProvider');
  }
  return notification;
}; 